//
//  UPdateVC.m
//  Book
//
//  Created by 123 on 16-3-31.
//  Copyright (c) 2016年 陈凯. All rights reserved.
//

#import "UPdateVC.h"

@interface UPdateVC ()
{
    UILabel*label;
}
@end

@implementation UPdateVC

- (void)viewDidLoad {
    [super viewDidLoad];
    // Do any additional setup after loading the view from its nib.
    label=[[UILabel alloc]init];
    label.frame=CGRectMake(20, 100, 200, 40);
    [self.view addSubview:label];
  
    label.textColor=[UIColor redColor];
    
    [_datepicker addTarget:self action:@selector(click:) forControlEvents:UIControlEventValueChanged];
}
-(void)click:(UIDatePicker*)picker{
    NSDate*date=picker.date;
    NSDateFormatter*form=[[NSDateFormatter alloc]init];
    [form setDateFormat:@"yyyy"];
   label.text=[form stringFromDate:date];
}

-(void)viewWillDisappear:(BOOL)animated{
    _delegate.m=label.text;
    
}

- (void)didReceiveMemoryWarning {
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}

/*
#pragma mark - Navigation

// In a storyboard-based application, you will often want to do a little preparation before navigation
- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender {
    // Get the new view controller using [segue destinationViewController].
    // Pass the selected object to the new view controller.
}
*/

@end
